home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir24 / jnos110g.zip / NETUSER.H < prev    next >
C/C++ Source or Header  |  1994-04-17  |  2KB  |  63 lines

  1. /* Mods by G1EMM */
  2. #ifndef _NETUSER_H
  3. #define _NETUSER_H
  4.   
  5. /* Global structures and constants needed by an Internet user process */
  6.   
  7. #ifndef _GLOBAL_H
  8. #include "global.h"
  9. #endif
  10.   
  11. #define NCONN   20              /* Maximum number of open network connections */
  12.   
  13. extern int32 Ip_addr;   /* Our IP address */
  14. extern int Net_error;   /* Error return code */
  15. #define NONE            0       /* No error */
  16. #define CON_EXISTS      1       /* Connection already exists */
  17. #define NO_CONN         2       /* Connection does not exist */
  18. #define CON_CLOS        3       /* Connection closing */
  19. #define NO_MEM          4       /* No memory for TCB creation */
  20. #define WOULDBLK        5       /* Would block */
  21. #define NOPROTO         6       /* Protocol or mode not supported */
  22. #define INVALID         7       /* Invalid arguments */
  23. #define NOROUTE         8       /* No route exists */
  24.   
  25. #define INET_EOL        "\r\n"  /* Standard Internet end-of-line sequence */
  26.   
  27. /* Codes for the tcp_open call */
  28. #define TCP_PASSIVE     0
  29. #define TCP_ACTIVE      1
  30. #define TCP_SERVER      2       /* Passive, clone on opening */
  31.   
  32. /* Local IP wildcard address */
  33. #define INADDR_ANY      0x0L
  34.   
  35. /* Socket structure */
  36. #ifdef LINUX
  37. #ifndef socket
  38. #include "socket.h"
  39. #endif
  40. #endif
  41. struct socket {
  42.     int32 address;          /* IP address */
  43.     int16 port;             /* port number */
  44. };
  45. #define NULLSOCK        (struct socket *)0
  46.   
  47. /* Connection structure (two sockets) */
  48. struct connection {
  49.     struct socket local;
  50.     struct socket remote;
  51. };
  52. /* In domain.c: */
  53. int32 resolve __ARGS((char *name));
  54. int32 resolve_mx __ARGS((char *name));
  55.   
  56. /* In netuser.c: */
  57. int32 aton __ARGS((char *s));
  58. char *inet_ntoa __ARGS((int32 a));
  59. char *pinet __ARGS((struct socket *s));
  60. char *inet_ntobos __ARGS((int32 a));
  61.   
  62. #endif  /* _NETUSER_H */
  63.